package xyz.luhui1hao.sell.utils;

import xyz.luhui1hao.sell.vo.ResultVO;

/**
 * @ClassName ResultVOUtil
 * @Description TODO
 * @Author luhui1hao
 * @Date 2018/8/21 上午11:15
 * @Version 1.0
 */
public class ResultVOUtil {

    public static ResultVO success(Object object){
        ResultVO resultVO = new ResultVO();
        resultVO.setData(object);
        resultVO.setCode(0);
        resultVO.setMessage("SUCCESS");
        return resultVO;
    }

    public static ResultVO success(){
        return success(null);
    }

    public static ResultVO error(Integer code, String msg){
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(code);
        resultVO.setMessage(msg);
        return resultVO;
    }
}
